Feature: Book Genie Mode - Automated Testing with Detailed Reporting
File name: BookGenie.feature
Relative path: features/BookGenie.feature
Scenario Outline: Book Genie Response Validation with Citation Verification
Error: No book data extracted from BookGenie response.
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:46:15)
at /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:8:71
at __awaiter (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:4:12)
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:59:12)
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification === [6:15:52 PM] Navigating to Creative Workspace login page [6:15:55 PM] Homepage visibility: false [6:15:55 PM] ℹ️ Typing query: "Suggest 5 books on christmas" [6:15:55 PM] ℹ️ Preparing to type query: "Suggest 5 books on christmas" [6:15:55 PM] ℹ️ Waiting for chat input to be visible [6:15:56 PM] ℹ️ Clearing chat input [6:15:57 PM] ℹ️ Typing query: "Suggest 5 books on christmas" [6:15:58 PM] ℹ️ Pressing Enter to submit query [6:15:58 PM] ✅ Query submitted successfully: "Suggest 5 books on christmas" [6:15:58 PM] ℹ️ Waiting for AI to complete thinking... [6:15:58 PM] 📋 WAITING FOR AI RESPONSE [6:15:58 PM] ℹ️ Looking for AI thinking indicator... [6:15:58 PM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes) [6:16:00 PM] ✅ ✓ AI thinking indicator appeared - AI is processing the request [6:16:00 PM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes) [6:16:02 PM] ✅ ✓ AI thinking completed - Response should be ready [6:16:02 PM] ℹ️ Allowing additional time for response rendering [6:16:05 PM] ✅ AI response wait process completed [6:16:05 PM] ℹ️ Validating response for query: "Suggest 5 books on christmas" [6:16:05 PM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 5 books on christmas" [6:16:05 PM] ℹ️ Locating the latest response in chat [6:16:05 PM] ℹ️ Waiting for response to be visible (max 30 seconds) [6:16:05 PM] ✅ Response received - Length: 608 characters [6:16:05 PM] ℹ️ Response preview: Watch Me WorkInterpreting context for your query...That sounds like a lovely theme! To help you find... [6:16:05 PM] ℹ️ Extracting book data from response... [6:16:05 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE [6:16:05 PM] ℹ️ Locating BookGenie response container [6:16:05 PM] ℹ️ Extracting HTML content from response [6:16:05 PM] ℹ️ HTML content extracted - Length: 7160 characters [6:16:05 PM] ℹ️ Parsing HTML to extract book data [6:16:05 PM] ✅ SUCCESSFULLY EXTRACTED 0 BOOKS [6:16:05 PM] 📋 EXTRACTED BOOKS SUMMARY [6:16:05 PM] 📊 Total books extracted: 0 [6:16:05 PM] 📊 Average relevance score: 0% [6:16:05 PM] ✅ Extracted 0 books from response === END LOGS ===
Scenario Logs: Book Genie Response Validation with Citation Verification
Scenario Outline: Book Genie Response Validation with Citation Verification
CITATION VALIDATION DETAILED REPORT ================================================================================ BOOK: Araminta Spookie 3: Frognapped ------------------------------------------------------------ ✅ Reason 1: PASS (100%) ❌ Reason 2: FAIL (0%) 📝 Reason: It involves Araminta and Wanda forming the "Spookie-Wizzard Detective Agency"... 📚 Citation: children... ⚠️ Citation text not found in reason: "children" ❌ Reason 3: FAIL (0%) 📝 Reason: The book includes illustrations by Jimmy Pickering... 📚 Citation: forming the "Spookie-Wizzard Detective Agency"... ⚠️ Citation text not found in reason: "forming the "Spookie-Wizzard Detective Agency"" BOOK: A Christmas Carol ------------------------------------------------------------ ❌ Reason 1: FAIL (0%) 📝 Reason: The book is a classic children's story... 📚 Citation: childrens christmas books... ⚠️ Citation text not found in reason: "childrens christmas books" ❌ Reason 2: FAIL (0%) 📝 Reason: It falls under the genre of JUVENILE FICTION: Classics... 📚 Citation: Audience: Interest age, years: from 6 to 10... ⚠️ Citation text not found in reason: "Audience: Interest age, years: from 6 to 10" ❌ Reason 3: FAIL (0%) 📝 Reason: The book is a coloring book... 📚 Citation: JUVENILE FICTION: Classics... ⚠️ Citation text not found in reason: "JUVENILE FICTION: Classics" BOOK: A Series of Unfortunate Events #1: The Bad Beginning ------------------------------------------------------------ ❌ Reason 1: FAIL (0%) 📝 Reason: The book is part of the "A Series of Unfortunate Events" series... 📚 Citation: children... ⚠️ Citation text not found in reason: "children" ❌ Reason 2: FAIL (0%) 📝 Reason: It falls under the genre of JUVENILE FICTION... 📚 Citation: Audience: Interest age, years: from 8 to 12... ⚠️ Citation text not found in reason: "Audience: Interest age, years: from 8 to 12" ❌ Reason 3: FAIL (0%) 📝 Reason: The book includes illustrations... 📚 Citation: JUVENILE FICTION... ⚠️ Citation text not found in reason: "JUVENILE FICTION" SUMMARY: 1/9 reasons passed (11.1%) OVERALL STATUS: FAIL
Citation validation failed: 1/9 passed (11.1%)
Citation Validation Summary: 1/9 passed
📊 Citation Validation Report
Generated on 10/9/2025, 6:18:50 PM
📖 Araminta Spookie 3: Frognapped
📖 A Christmas Carol
📖 A Series of Unfortunate Events #1: The Bad Beginning
📈 Validation Summary
PER-BOOK AI VALIDATION REPORT - Query: "Suggest 3 books for childrens"
================================================================================
OVERALL RELEVANCE SCORE: 70%
STATUS: FAIL
BOOKS ANALYZED: 3
BOOK 1: "Araminta Spookie 3: Frognapped"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 2: "A Christmas Carol"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 3: "A Series of Unfortunate Events #1: The Bad Beginning"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
SUMMARY FEEDBACK:
----------------------------------------
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 2.674834136s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"2s"}]
OVERALL IMPROVEMENT SUGGESTIONS:
----------------------------------------
• Retry the analysis when Gemini API is less busy
• Consider running tests during off-peak hours
• Check Google AI status page for service updates
🤖 PER-BOOK AI Response Relevance Validation
Query: "Suggest 3 books for childrens"
Overall Relevance Score: 70%
Status: FAIL
Books Analyzed: 3
Individual Book Analyses
📖 Book 1: "Araminta Spookie 3: Frognapped" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 2: "A Christmas Carol" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 3: "A Series of Unfortunate Events #1: The Bad Beginning" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
Summary Feedback
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. * Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2 Please retry in 2.674834136s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"2s"}]
Overall Improvement Suggestions
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification ===
[6:16:06 PM] Navigating to Creative Workspace login page
[6:16:09 PM] Homepage visibility: false
[6:16:09 PM] ℹ️ Typing query: "Suggest 3 books for childrens"
[6:16:09 PM] ℹ️ Preparing to type query: "Suggest 3 books for childrens"
[6:16:09 PM] ℹ️ Waiting for chat input to be visible
[6:16:10 PM] ℹ️ Clearing chat input
[6:16:10 PM] ℹ️ Typing query: "Suggest 3 books for childrens"
[6:16:11 PM] ℹ️ Pressing Enter to submit query
[6:16:12 PM] ✅ Query submitted successfully: "Suggest 3 books for childrens"
[6:16:12 PM] ℹ️ Waiting for AI to complete thinking...
[6:16:12 PM] 📋 WAITING FOR AI RESPONSE
[6:16:12 PM] ℹ️ Looking for AI thinking indicator...
[6:16:12 PM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes)
[6:16:13 PM] ✅ ✓ AI thinking indicator appeared - AI is processing the request
[6:16:13 PM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes)
[6:16:28 PM] ✅ ✓ AI thinking completed - Response should be ready
[6:16:28 PM] ℹ️ Allowing additional time for response rendering
[6:16:31 PM] ✅ AI response wait process completed
[6:16:31 PM] ℹ️ Validating response for query: "Suggest 3 books for childrens"
[6:16:31 PM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 3 books for childrens"
[6:16:31 PM] ℹ️ Locating the latest response in chat
[6:16:31 PM] ℹ️ Waiting for response to be visible (max 30 seconds)
[6:16:31 PM] ✅ Response received - Length: 2114 characters
[6:16:31 PM] ℹ️ Response preview: Watch Me WorkRetrieving Relevant Books for 'books suitable for children' in Book Summary ...Interpre...
[6:16:31 PM] ℹ️ Extracting book data from response...
[6:16:31 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[6:16:31 PM] ℹ️ Locating BookGenie response container
[6:16:31 PM] ℹ️ Extracting HTML content from response
[6:16:31 PM] ℹ️ HTML content extracted - Length: 32129 characters
[6:16:31 PM] ℹ️ Parsing HTML to extract book data
[6:16:31 PM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[6:16:31 PM] 📋 EXTRACTED BOOKS SUMMARY
[6:16:31 PM] 📚 1. "Araminta Spookie 3: Frognapped" - Score: 100%%
[6:16:31 PM] 📚 2. "A Christmas Carol" - Score: 100%%
[6:16:31 PM] 📚 3. "A Series of Unfortunate Events #1: The Bad Beginning" - Score: 100%%
[6:16:31 PM] 📊 Total books extracted: 3
[6:16:31 PM] 📊 Average relevance score: 100%
[6:16:31 PM] ✅ Extracted 3 books from response
[6:16:31 PM] ℹ️ Saving 3 books to Excel file: test_results/suggest_3_books_for_childrens.xlsx
[6:16:31 PM] 📋 SAVING BOOKS TO EXCEL FILE
[6:16:31 PM] ℹ️ Target file path: test_results/suggest_3_books_for_childrens.xlsx
[6:16:31 PM] ℹ️ Exporting 3 books to Excel format
[6:16:31 PM] ✅ Book data saved to: test_results/suggest_3_books_for_childrens.xlsx
[6:16:31 PM] 📊 File verified - Size: 16.87 KB
[6:16:31 PM] ✅ ✓ Excel file creation verified successfully
[6:16:31 PM] 📋 STARTING INDIVIDUAL BOOK VALIDATION (3 books) for query: "Suggest 3 books for childrens"
[6:16:31 PM] 📋 📚 VALIDATING BOOK 1: "Araminta Spookie 3: Frognapped"
[6:16:31 PM] ℹ️ Starting comprehensive book validation
[6:16:31 PM] ℹ️ Validating title: "Araminta Spookie 3: Frognapped" vs expected: "Araminta Spookie 3: Frognapped"
[6:16:31 PM] ✅ ✅ TITLE VALIDATION PASSED: "Araminta Spookie 3: Frognapped"
[6:16:31 PM] ℹ️ Validating score: 100% vs expected: 100%
[6:16:31 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[6:16:31 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[6:16:31 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[6:16:31 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[6:16:31 PM] ✅ 🎉 BOOK 1 VALIDATION: ALL CHECKS PASSED!
[6:16:31 PM] ℹ️ Book 1 validation completed
[6:16:31 PM] 📋 📚 VALIDATING BOOK 2: "A Christmas Carol"
[6:16:31 PM] ℹ️ Starting comprehensive book validation
[6:16:31 PM] ℹ️ Validating title: "A Christmas Carol" vs expected: "A Christmas Carol"
[6:16:31 PM] ✅ ✅ TITLE VALIDATION PASSED: "A Christmas Carol"
[6:16:31 PM] ℹ️ Validating score: 100% vs expected: 100%
[6:16:31 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[6:16:31 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[6:16:31 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[6:16:31 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[6:16:31 PM] ✅ 🎉 BOOK 2 VALIDATION: ALL CHECKS PASSED!
[6:16:31 PM] ℹ️ Book 2 validation completed
[6:16:31 PM] 📋 📚 VALIDATING BOOK 3: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:16:31 PM] ℹ️ Starting comprehensive book validation
[6:16:31 PM] ℹ️ Validating title: "A Series of Unfortunate Events #1: The Bad Beginning" vs expected: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:16:31 PM] ✅ ✅ TITLE VALIDATION PASSED: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:16:31 PM] ℹ️ Validating score: 100% vs expected: 100%
[6:16:31 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[6:16:31 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[6:16:31 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[6:16:31 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[6:16:31 PM] ✅ 🎉 BOOK 3 VALIDATION: ALL CHECKS PASSED!
[6:16:31 PM] ℹ️ Book 3 validation completed
[6:16:31 PM] 📊 VALIDATION SUMMARY: 3/3 books passed
[6:16:31 PM] ✅ ALL BOOKS VALIDATED SUCCESSFULLY!
[6:16:31 PM] 📋 🔍 VALIDATING REASON-CITATION MATCHES
[6:16:31 PM] ℹ️ Starting citation validation process...
[6:16:31 PM] 📋 🚀 STARTING COMPLETE CITATION VALIDATION WORKFLOW
[6:16:31 PM] ℹ️ Step 1: Extracting books from AI response
[6:16:31 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[6:16:31 PM] ℹ️ Locating BookGenie response container
[6:16:31 PM] ℹ️ Extracting HTML content from response
[6:16:31 PM] ℹ️ HTML content extracted - Length: 32129 characters
[6:16:31 PM] ℹ️ Parsing HTML to extract book data
[6:16:31 PM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[6:16:31 PM] 📋 EXTRACTED BOOKS SUMMARY
[6:16:31 PM] 📚 1. "Araminta Spookie 3: Frognapped" - Score: 100%%
[6:16:31 PM] 📚 2. "A Christmas Carol" - Score: 100%%
[6:16:31 PM] 📚 3. "A Series of Unfortunate Events #1: The Bad Beginning" - Score: 100%%
[6:16:31 PM] 📊 Total books extracted: 3
[6:16:31 PM] 📊 Average relevance score: 100%
[6:16:31 PM] ℹ️ Step 2: Extracting citation texts from book elements
[6:16:31 PM] 📋 📚 EXTRACTING CITATION TEXTS FROM BOOK ELEMENTS
[6:16:31 PM] ℹ️ Step 1: Waiting for main book section
[6:16:31 PM] ℹ️ Found 7 total accordion sections
[6:16:31 PM] ℹ️ Found individual book: "1. Araminta Spookie 3: Frognapped"
[6:16:31 PM] ℹ️ Found individual book: "2. A Christmas Carol"
[6:16:31 PM] ℹ️ Found individual book: "3. A Series of Unfortunate Events #1: The Bad Beginning"
[6:16:31 PM] ℹ️ Processing 3 individual book sections
[6:16:31 PM] 📋 📖 PROCESSING BOOK 1: "Araminta Spookie 3: Frognapped"
[6:16:31 PM] ℹ️ Expanding book section: "Araminta Spookie 3: Frognapped"
[6:16:34 PM] ✅ Book section expanded: "Araminta Spookie 3: Frognapped"
[6:16:34 PM] ℹ️ Expanding "Why this book is the match" section for: "Araminta Spookie 3: Frognapped"
[6:16:37 PM] ✅ "Why this book is the match" section expanded for: "Araminta Spookie 3: Frognapped"
[6:16:37 PM] ℹ️ Found 6 citation buttons for "Araminta Spookie 3: Frognapped"
[6:16:37 PM] ℹ️ Extracting citation 1/6 for "Araminta Spookie 3: Frognapped"
[6:16:37 PM] ℹ️ Processing manuscript citation 1 for "Araminta Spookie 3: Frognapped"
[6:16:38 PM] ℹ️ Clicking to OPEN manuscript citation 1
[6:16:40 PM] ℹ️ Extracted citation text (first 100 chars): Araminta Spookie...
[6:16:40 PM] ℹ️ Clicking to CLOSE manuscript citation 1
[6:16:42 PM] ✅ ✅ manuscript citation 1 closed successfully
[6:16:42 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 16)
[6:16:42 PM] ℹ️ Extracting citation 2/6 for "Araminta Spookie 3: Frognapped"
[6:16:42 PM] ℹ️ Processing metadata citation 2 for "Araminta Spookie 3: Frognapped"
[6:16:43 PM] ℹ️ Clicking to OPEN metadata citation 2
[6:16:45 PM] ℹ️ Extracted citation text (first 100 chars): children...
[6:16:45 PM] ℹ️ Clicking to CLOSE metadata citation 2
[6:16:47 PM] ✅ ✅ metadata citation 2 closed successfully
[6:16:47 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 8)
[6:16:47 PM] ℹ️ Extracting citation 3/6 for "Araminta Spookie 3: Frognapped"
[6:16:47 PM] ℹ️ Processing manuscript citation 3 for "Araminta Spookie 3: Frognapped"
[6:16:48 PM] ℹ️ Clicking to OPEN manuscript citation 3
[6:16:50 PM] ℹ️ Extracted citation text (first 100 chars): forming the "Spookie-Wizzard Detective Agency"...
[6:16:50 PM] ℹ️ Clicking to CLOSE manuscript citation 3
[6:16:51 PM] ✅ ✅ manuscript citation 3 closed successfully
[6:16:51 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 46)
[6:16:51 PM] ℹ️ Extracting citation 4/6 for "Araminta Spookie 3: Frognapped"
[6:16:51 PM] ℹ️ Processing metadata citation 4 for "Araminta Spookie 3: Frognapped"
[6:16:52 PM] ℹ️ Clicking to OPEN metadata citation 4
[6:16:54 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Horror...
[6:16:54 PM] ℹ️ Clicking to CLOSE metadata citation 4
[6:16:56 PM] ✅ ✅ metadata citation 4 closed successfully
[6:16:56 PM] ℹ️ ✅ Citation 4 extracted successfully (length: 24)
[6:16:56 PM] ℹ️ Extracting citation 5/6 for "Araminta Spookie 3: Frognapped"
[6:16:56 PM] ℹ️ Processing manuscript citation 5 for "Araminta Spookie 3: Frognapped"
[6:16:57 PM] ℹ️ Clicking to OPEN manuscript citation 5
[6:16:59 PM] ℹ️ Extracted citation text (first 100 chars): illustrator Jimmy Pickering for the distinctive cover art...
[6:16:59 PM] ℹ️ Clicking to CLOSE manuscript citation 5
[6:17:00 PM] ✅ ✅ manuscript citation 5 closed successfully
[6:17:00 PM] ℹ️ ✅ Citation 5 extracted successfully (length: 57)
[6:17:00 PM] ℹ️ Extracting citation 6/6 for "Araminta Spookie 3: Frognapped"
[6:17:01 PM] ℹ️ Processing metadata citation 6 for "Araminta Spookie 3: Frognapped"
[6:17:02 PM] ℹ️ Clicking to OPEN metadata citation 6
[6:17:04 PM] ℹ️ Extracted citation text (first 100 chars): children...
[6:17:04 PM] ℹ️ Clicking to CLOSE metadata citation 6
[6:17:05 PM] ✅ ✅ metadata citation 6 closed successfully
[6:17:05 PM] ℹ️ ✅ Citation 6 extracted successfully (length: 8)
[6:17:05 PM] ℹ️ Collapsing book section: "Araminta Spookie 3: Frognapped"
[6:17:07 PM] ✅ Book section collapsed: "Araminta Spookie 3: Frognapped"
[6:17:07 PM] ✅ ✅ Completed processing "Araminta Spookie 3: Frognapped" - 6 citations extracted
[6:17:07 PM] 📋 📖 PROCESSING BOOK 2: "A Christmas Carol"
[6:17:07 PM] ℹ️ Expanding book section: "A Christmas Carol"
[6:17:10 PM] ✅ Book section expanded: "A Christmas Carol"
[6:17:10 PM] ℹ️ Expanding "Why this book is the match" section for: "A Christmas Carol"
[6:17:13 PM] ✅ "Why this book is the match" section expanded for: "A Christmas Carol"
[6:17:13 PM] ℹ️ Found 6 citation buttons for "A Christmas Carol"
[6:17:13 PM] ℹ️ Extracting citation 1/6 for "A Christmas Carol"
[6:17:13 PM] ℹ️ Processing metadata citation 1 for "A Christmas Carol"
[6:17:14 PM] ℹ️ Clicking to OPEN metadata citation 1
[6:17:16 PM] ℹ️ Extracted citation text (first 100 chars): childrens christmas books...
[6:17:16 PM] ℹ️ Clicking to CLOSE metadata citation 1
[6:17:17 PM] ✅ ✅ metadata citation 1 closed successfully
[6:17:17 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 25)
[6:17:17 PM] ℹ️ Extracting citation 2/6 for "A Christmas Carol"
[6:17:17 PM] ℹ️ Processing metadata citation 2 for "A Christmas Carol"
[6:17:18 PM] ℹ️ Clicking to OPEN metadata citation 2
[6:17:21 PM] ℹ️ Extracted citation text (first 100 chars): Audience:
Interest age, years: from 6 to 10...
[6:17:21 PM] ℹ️ Clicking to CLOSE metadata citation 2
[6:17:22 PM] ✅ ✅ metadata citation 2 closed successfully
[6:17:22 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 44)
[6:17:22 PM] ℹ️ Extracting citation 3/6 for "A Christmas Carol"
[6:17:22 PM] ℹ️ Processing metadata citation 3 for "A Christmas Carol"
[6:17:23 PM] ℹ️ Clicking to OPEN metadata citation 3
[6:17:25 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Classics...
[6:17:25 PM] ℹ️ Clicking to CLOSE metadata citation 3
[6:17:27 PM] ✅ ✅ metadata citation 3 closed successfully
[6:17:27 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 26)
[6:17:27 PM] ℹ️ Extracting citation 4/6 for "A Christmas Carol"
[6:17:27 PM] ℹ️ Processing metadata citation 4 for "A Christmas Carol"
[6:17:28 PM] ℹ️ Clicking to OPEN metadata citation 4
[6:17:30 PM] ℹ️ Extracted citation text (first 100 chars): Audience:
Interest age, years: from 6 to 10...
[6:17:30 PM] ℹ️ Clicking to CLOSE metadata citation 4
[6:17:31 PM] ✅ ✅ metadata citation 4 closed successfully
[6:17:31 PM] ℹ️ ✅ Citation 4 extracted successfully (length: 44)
[6:17:31 PM] ℹ️ Extracting citation 5/6 for "A Christmas Carol"
[6:17:31 PM] ℹ️ Processing metadata citation 5 for "A Christmas Carol"
[6:17:32 PM] ℹ️ Clicking to OPEN metadata citation 5
[6:17:34 PM] ℹ️ Extracted citation text (first 100 chars): coloring book...
[6:17:34 PM] ℹ️ Clicking to CLOSE metadata citation 5
[6:17:36 PM] ✅ ✅ metadata citation 5 closed successfully
[6:17:36 PM] ℹ️ ✅ Citation 5 extracted successfully (length: 13)
[6:17:36 PM] ℹ️ Extracting citation 6/6 for "A Christmas Carol"
[6:17:36 PM] ℹ️ Processing metadata citation 6 for "A Christmas Carol"
[6:17:37 PM] ℹ️ Clicking to OPEN metadata citation 6
[6:17:39 PM] ℹ️ Extracted citation text (first 100 chars): Interest age, years: from 6 to 10...
[6:17:39 PM] ℹ️ Clicking to CLOSE metadata citation 6
[6:17:41 PM] ✅ ✅ metadata citation 6 closed successfully
[6:17:41 PM] ℹ️ ✅ Citation 6 extracted successfully (length: 33)
[6:17:41 PM] ℹ️ Collapsing book section: "A Christmas Carol"
[6:17:42 PM] ✅ Book section collapsed: "A Christmas Carol"
[6:17:42 PM] ✅ ✅ Completed processing "A Christmas Carol" - 6 citations extracted
[6:17:42 PM] 📋 📖 PROCESSING BOOK 3: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:42 PM] ℹ️ Expanding book section: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:45 PM] ✅ Book section expanded: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:45 PM] ℹ️ Expanding "Why this book is the match" section for: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:48 PM] ✅ "Why this book is the match" section expanded for: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:48 PM] ℹ️ Found 6 citation buttons for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:48 PM] ℹ️ Extracting citation 1/6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:48 PM] ℹ️ Processing manuscript citation 1 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:49 PM] ℹ️ Clicking to OPEN manuscript citation 1
[6:17:51 PM] ℹ️ Extracted citation text (first 100 chars): children...
[6:17:51 PM] ℹ️ Clicking to CLOSE manuscript citation 1
[6:17:53 PM] ✅ ✅ manuscript citation 1 closed successfully
[6:17:53 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 8)
[6:17:53 PM] ℹ️ Extracting citation 2/6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:53 PM] ℹ️ Processing metadata citation 2 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:54 PM] ℹ️ Clicking to OPEN metadata citation 2
[6:17:56 PM] ℹ️ Extracted citation text (first 100 chars): Audience:
Interest age, years: from 8 to 12...
[6:17:56 PM] ℹ️ Clicking to CLOSE metadata citation 2
[6:17:57 PM] ✅ ✅ metadata citation 2 closed successfully
[6:17:57 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 44)
[6:17:57 PM] ℹ️ Extracting citation 3/6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:57 PM] ℹ️ Processing metadata citation 3 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:17:59 PM] ℹ️ Clicking to OPEN metadata citation 3
[6:18:01 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION...
[6:18:01 PM] ℹ️ Clicking to CLOSE metadata citation 3
[6:18:02 PM] ✅ ✅ metadata citation 3 closed successfully
[6:18:02 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 16)
[6:18:02 PM] ℹ️ Extracting citation 4/6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:02 PM] ℹ️ Processing metadata citation 4 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:03 PM] ℹ️ Clicking to OPEN metadata citation 4
[6:18:05 PM] ℹ️ Extracted citation text (first 100 chars): Audience:
Interest age, years: from 8 to 12...
[6:18:05 PM] ℹ️ Clicking to CLOSE metadata citation 4
[6:18:07 PM] ✅ ✅ metadata citation 4 closed successfully
[6:18:07 PM] ℹ️ ✅ Citation 4 extracted successfully (length: 44)
[6:18:07 PM] ℹ️ Extracting citation 5/6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:07 PM] ℹ️ Processing manuscript citation 5 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:08 PM] ℹ️ Clicking to OPEN manuscript citation 5
[6:18:10 PM] ℹ️ Extracted citation text (first 100 chars): image...
[6:18:10 PM] ℹ️ Clicking to CLOSE manuscript citation 5
[6:18:11 PM] ✅ ✅ manuscript citation 5 closed successfully
[6:18:11 PM] ℹ️ ✅ Citation 5 extracted successfully (length: 5)
[6:18:11 PM] ℹ️ Extracting citation 6/6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:11 PM] ℹ️ Processing metadata citation 6 for "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:12 PM] ℹ️ Clicking to OPEN metadata citation 6
[6:18:14 PM] ℹ️ Extracted citation text (first 100 chars): Interest age, years: from 8 to 12...
[6:18:14 PM] ℹ️ Clicking to CLOSE metadata citation 6
[6:18:16 PM] ✅ ✅ metadata citation 6 closed successfully
[6:18:16 PM] ℹ️ ✅ Citation 6 extracted successfully (length: 33)
[6:18:16 PM] ℹ️ Collapsing book section: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:17 PM] ✅ Book section collapsed: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:17 PM] ✅ ✅ Completed processing "A Series of Unfortunate Events #1: The Bad Beginning" - 6 citations extracted
[6:18:17 PM] ✅ 🎉 Successfully extracted citations from 3 books
[6:18:17 PM] ℹ️ Step 3: Validating reason-citation matches
[6:18:17 PM] 📋 🔍 VALIDATING REASON-CITATION MATCHES (80% THRESHOLD)
[6:18:17 PM] ℹ️ 📖 Validating 3 reasons for: "Araminta Spookie 3: Frognapped"
[6:18:17 PM] ℹ️ Reason 1: Checking match...
[6:18:17 PM] ✅ ✅ "Araminta Spookie 3: Frognapped" - Reason 1: 100% match - PASS
[6:18:17 PM] ℹ️ Reason 2: Checking match...
[6:18:30 PM] ❌ ❌ "Araminta Spookie 3: Frognapped" - Reason 2: 0% match - FAIL
[6:18:30 PM] ❌ ⚠️ Citation text not found in reason: "children"
[6:18:30 PM] ℹ️ Reason 3: Checking match...
[6:18:40 PM] ❌ ❌ "Araminta Spookie 3: Frognapped" - Reason 3: 0% match - FAIL
[6:18:40 PM] ❌ ⚠️ Citation text not found in reason: "forming the "Spookie-Wizzard Detective Agency""
[6:18:40 PM] ℹ️ 📖 Validating 3 reasons for: "A Christmas Carol"
[6:18:40 PM] ℹ️ Reason 1: Checking match...
[6:18:50 PM] ❌ ❌ "A Christmas Carol" - Reason 1: 0% match - FAIL
[6:18:50 PM] ❌ ⚠️ Citation text not found in reason: "childrens christmas books"
[6:18:50 PM] ℹ️ Reason 2: Checking match...
[6:18:50 PM] ❌ ❌ "A Christmas Carol" - Reason 2: 0% match - FAIL
[6:18:50 PM] ❌ ⚠️ Citation text not found in reason: "Audience:
Interest age, years: from 6 to 10"
[6:18:50 PM] ℹ️ Reason 3: Checking match...
[6:18:50 PM] ❌ ❌ "A Christmas Carol" - Reason 3: 0% match - FAIL
[6:18:50 PM] ❌ ⚠️ Citation text not found in reason: "JUVENILE FICTION: Classics"
[6:18:50 PM] ℹ️ 📖 Validating 3 reasons for: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:50 PM] ℹ️ Reason 1: Checking match...
[6:18:50 PM] ❌ ❌ "A Series of Unfortunate Events #1: The Bad Beginning" - Reason 1: 0% match - FAIL
[6:18:50 PM] ❌ ⚠️ Citation text not found in reason: "children"
[6:18:50 PM] ℹ️ Reason 2: Checking match...
[6:18:50 PM] ❌ ❌ "A Series of Unfortunate Events #1: The Bad Beginning" - Reason 2: 0% match - FAIL
[6:18:50 PM] ❌ ⚠️ Citation text not found in reason: "Audience:
Interest age, years: from 8 to 12"
[6:18:50 PM] ℹ️ Reason 3: Checking match...
[6:18:50 PM] ❌ ❌ "A Series of Unfortunate Events #1: The Bad Beginning" - Reason 3: 0% match - FAIL
[6:18:50 PM] ❌ ⚠️ Citation text not found in reason: "JUVENILE FICTION"
[6:18:50 PM] 📊 📊 CITATION VALIDATION SUMMARY: 1/9 passed (11.1%)
[6:18:50 PM] ❌ 💥 REASON-CITATION VALIDATION: OVERALL FAILED
[6:18:50 PM] ℹ️ Step 4: Generating detailed report
[6:18:50 PM] 📋 📋 GENERATING CITATION VALIDATION REPORT
[6:18:50 PM] ℹ️ Report generated: 1/9 reasons passed
[6:18:50 PM] ✅ ✅ Citation validation workflow completed successfully
[6:18:50 PM] 📊 📈 OVERALL CITATION VALIDATION: 1/9 (11.1%)
[6:18:50 PM] ❌ ❌ REASON-CITATION VALIDATION: OVERALL FAILED - Only 11.1% of reasons match citations (required: 80%)
[6:18:50 PM] 📋 📋 GENERATING DETAILED CITATION VALIDATION REPORT
[6:18:50 PM] ℹ️ Generating HTML citation validation report
[6:18:50 PM] ✅ Generated HTML report for 9 reasons
[6:18:50 PM] ✅ ✅ Citation validation HTML report generated and attached
[6:18:50 PM] ✅ ✅ Citation validation plain text report attached
[6:18:50 PM] ℹ️ Checking database connectivity...
[6:18:50 PM] ✅ ✅ Database connected successfully
[6:18:50 PM] ℹ️ Database path: /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/test_data/database.xlsx
[6:18:50 PM] ℹ️ Total books: 5455
[6:18:50 PM] 📊 Database contains 5455 books
[6:18:50 PM] ✅ ✅ Database book count requirement met: 5455 >= 2020
[6:18:50 PM] 📋 🔍 VALIDATING EXTRACTED BOOKS INDIVIDUALLY AGAINST DATABASE
[6:18:50 PM] ℹ️ Checking book 1/3: "Araminta Spookie 3: Frognapped"
[6:18:50 PM] ℹ️ Checking if book exists in database: "Araminta Spookie 3: Frognapped"
[6:18:50 PM] ✅ ✅ Database match: "Araminta Spookie 3: Frognapped" → "Araminta Spookie 3: Frognapped"
[6:18:50 PM] ℹ️ Checking book 2/3: "A Christmas Carol"
[6:18:50 PM] ℹ️ Checking if book exists in database: "A Christmas Carol"
[6:18:51 PM] ✅ ✅ Database match: "A Christmas Carol" → "A Christmas Carol"
[6:18:51 PM] ℹ️ Checking book 3/3: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:51 PM] ℹ️ Checking if book exists in database: "A Series of Unfortunate Events #1: The Bad Beginning"
[6:18:51 PM] ✅ ✅ Database match: "A Series of Unfortunate Events #1: The Bad Beginning" → "He"
[6:18:51 PM] 📊 INDIVIDUAL DATABASE VALIDATION SUMMARY: 3/3 books found in database
[6:18:51 PM] ✅ 🎉 ALL BOOKS VALIDATED SUCCESSFULLY AGAINST DATABASE!
[6:18:51 PM] 📋 🤖 VALIDATING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[6:18:51 PM] ℹ️ Starting Gemini AI per-book relevance validation...
[6:18:51 PM] 📋 🤖 ANALYZING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[6:18:51 PM] ℹ️ Starting Gemini AI analysis with retry logic...
[6:18:57 PM] ⚠ ⚠️ GEMINI VALIDATION: Using fallback analysis due to API issues
[6:18:57 PM] ℹ️ Overall Score: 70% (Fallback)
[6:18:57 PM] 📋 📖 ANALYSIS FOR: "Araminta Spookie 3: Frognapped" - Score: 70%
[6:18:57 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ 💡 Book-specific improvements:
[6:18:57 PM] ℹ️ - Retry analysis when service is available
[6:18:57 PM] 📋 📖 ANALYSIS FOR: "A Christmas Carol" - Score: 70%
[6:18:57 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ 💡 Book-specific improvements:
[6:18:57 PM] ℹ️ - Retry analysis when service is available
[6:18:57 PM] 📋 📖 ANALYSIS FOR: "A Series of Unfortunate Events #1: The Bad Beginning" - Score: 70%
[6:18:57 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[6:18:57 PM] ℹ️ 💡 Book-specific improvements:
[6:18:57 PM] ℹ️ - Retry analysis when service is available
[6:18:57 PM] ℹ️ 📊 SUMMARY FEEDBACK:
[6:18:57 PM] ℹ️ • AI analysis service is temporarily overloaded
[6:18:57 PM] ℹ️ • Using fallback analysis with neutral scores
[6:18:57 PM] ℹ️ • Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 2.674834136s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"2s"}]
[6:18:57 PM] ❌ ❌ GEMINI AI VALIDATION FAILED: 70% relevance score (required: 80%)
[6:18:57 PM] ℹ️ Continuing execution due to soft assertion...
=== END LOGS ===